import request from '@/utils/request'

// 根据机构编码获取该机构下属所有地块
export function getAcrePlanByYear(query) {
    return request({
        url: '/distribute/WiOrgplanM/getWiLandBListByOrgCd',
        method: 'get',
        params: query
    })
}
// 根据农户编码获取该机构下属所有地块
export function getWiLandBListByFarmCd(query) {
  return request({
      url: '/distribute/WiFarmplanM/getWiLandBListByFarmCd',
      method: 'get',
      params: query
  })
}

// 查询月机构限额水量及计划水量计算列表
export function listWiOrgplanM(query) {
  return request({
    url: '/distribute/WiOrgplanM/list',
    method: 'get',
    params: query
  })
}
// 查询月农户限额水量及计划水量计算列表
export function listWiFarmplanM(query) {
  return request({
    url: '/distribute/WiFarmplanM/list',
    method: 'get',
    params: query
  })
}


// 汇总该机构当年各月旬计划
export function OrgcalcTenPlan(query) {
  return request({
    url: '/distribute/WiOrgplanM/calcTenPlan',
    method: 'get',
    params: query
  })
}
// 汇总该机构当年各月旬计划
export function FarmcalcTenPlan(query) {
  return request({
    url: '/distribute/WiFarmplanM/calcTenPlan',
    method: 'get',
    params: query
  })
}
// 导入上一年计划数据-机构
export function importLastYearOrgPlan(query) {
  return request({
    url: '/distribute/WiOrgplanM/importLastYearPlan',
    method: 'get',
    params: query
  })
}
// 导入上一年计划数据-农户
export function importLastYearFarmPlan(query) {
  return request({
    url: '/distribute/WiFarmplanM/importLastYearPlan',
    method: 'get',
    params: query
  })
}


// 查询月机构限额水量及计划水量计算详细
export function getWiOrgplanM(orgCd) {
  return request({
    url: '/distribute/WiOrgplanM/' + orgCd,
    method: 'get'
  })
}

// 新增月机构限额水量及计划水量计算
export function addWiOrgplanM(data) {
  return request({
    url: '/distribute/WiOrgplanM',
    method: 'post',
    data: data
  })
}

// 修改月机构限额水量及计划水量计算
export function updateWiOrgplanM(data) {
  return request({
    url: '/distribute/WiOrgplanM',
    method: 'put',
    data: data
  })
}

// 删除月机构限额水量及计划水量计算
export function delWiOrgplanM(orgCd) {
  return request({
    url: '/distribute/WiOrgplanM/' + orgCd,
    method: 'delete'
  })
}
